package models;

import play.*;
import play.data.validation.Required;
import play.db.jpa.*;

import javax.persistence.*;
import java.util.*;

/**
 * 商品实体，存放固有属性
 * 关于价格：
 * 1.进货价改变的话，另建实体
 * 2.销售价／会员价不在此实体保存，价格与特定的用户组／用户关联 
 * 
 * @see models.PricedCommodity
 * 
 * @author justin
 *
 */
@Entity
public class CommodityImage extends Model {

	/*大图*/
	@Required
	@OneToOne(cascade=CascadeType.ALL)
	public Attachment image;
	
	/*顺序*/
	public int sequence;
	
	@ManyToOne
	public Commodity commodity;
}
